<!DOCTYPE html>
<html lang="en" class="js csstransforms3d">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="generator" content="Hugo 0.20.7" />
    <meta name="description" content="">


    <link rel="shortcut icon" href="http://shardingjdbc.io/document/legacy/2.x/en/img/favicon.png" type="image/x-icon" />

    
    <title>The performance-test report</title>
    <link href="http://ovfotjrsi.bkt.clouddn.com/docs/css/nucleus.css" rel="stylesheet">
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="http://ovfotjrsi.bkt.clouddn.com/docs/css/theme.css" rel="stylesheet">
    <link href="http://ovfotjrsi.bkt.clouddn.com/docs/css/hugo-theme.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <style type="text/css">:root #header + #content > #left > #rlblock_left
    {display:none !important;}</style>
    <link rel="stylesheet" href="http://cdn.bootcss.com/highlight.js/9.8.0/styles/monokai-sublime.min.css">
<link rel="stylesheet" href="http://ovfotjrsi.bkt.clouddn.com/docs/css/style.css">
  </head>
  <body class="" data-url="/01-start/stress-test/">
    
    <nav id="sidebar">
  <div id="header-wrapper">
    <div id="header">
      <img src="http://ovfotjrsi.bkt.clouddn.com/docs/img/sharding-jdbc.png" />
    </div>
</div>
  <div class="highlightable">
    <ul class="topics">
      
        
        
          
          
            
          
        
          
          
            
          
        
          
          
            
          
        
          
          
            
          
        
        
        
          
        
          
        
          
        
          
        
      
      
      
      

      
      
      
        
          
          
            
          
        
      
      
      

      <li class="dd-item  " data-nav-id="/00-overview/">
        <a href="http://shardingjdbc.io/document/legacy/2.x/en/00-overview/">
          <span>
            
              <b>0. </b>
            
             Overview
            
           </span>
        </a>
        
        <ul>
          
            <li class="dd-item " data-nav-id="/00-overview/intro/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/00-overview/intro/">
                <span>Brief Introduction     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/00-overview/news/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/00-overview/news/">
                <span>News     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/00-overview/contribution/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/00-overview/contribution/">
                <span>Contribute Code     </i></span>
              </a>
            </li>
          
        </ul>
        
      </li>
      
      
      

      
      
      
        
          
          
            
          
        
      
      
      

      <li class="dd-item  parent" data-nav-id="/01-start/">
        <a href="http://shardingjdbc.io/document/legacy/2.x/en/01-start/">
          <span>
            
              <b>1. </b>
            
             Introduction
            
           </span>
        </a>
        
        <ul>
          
            <li class="dd-item " data-nav-id="/01-start/quick-start/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/01-start/quick-start/">
                <span>Quick Start     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/01-start/code-demo/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/01-start/code-demo/">
                <span>Usage Example     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/01-start/faq/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/01-start/faq/">
                <span>FAQ     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/01-start/features/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/01-start/features/">
                <span>Feature List     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/01-start/limitations/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/01-start/limitations/">
                <span>Use Limits     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/01-start/sql-supported/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/01-start/sql-supported/">
                <span>The list of available SQL syntax     </i></span>
              </a>
            </li>
          
            <li class="dd-item active" data-nav-id="/01-start/stress-test/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/01-start/stress-test/">
                <span>The performance-test report     </i></span>
              </a>
            </li>
          
        </ul>
        
      </li>
      
      
      

      
      
      
        
          
          
            
          
        
      
      
      

      <li class="dd-item  " data-nav-id="/02-guide/">
        <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/">
          <span>
            
              <b>2. </b>
            
             User Manual
            
           </span>
        </a>
        
        <ul>
          
            <li class="dd-item " data-nav-id="/02-guide/concepts/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/concepts/">
                <span>Basic Concepts      </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/sharding/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/sharding/">
                <span>Sharding     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/master-slave/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/master-slave/">
                <span>Read-write splitting     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/config_domain/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/config_domain/">
                <span>Domain Model Configuration     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/configuration/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/configuration/">
                <span>Configuration     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/orchestration/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/orchestration/">
                <span>Orchestration     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/hint-sharding-value/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/hint-sharding-value/">
                <span>Mandatory Routing     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/key-generator/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/key-generator/">
                <span>Distributed Primary key     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/transaction/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/transaction/">
                <span>Transaction Support     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/subquery/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/subquery/">
                <span>The Pagination and subquery     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/test-framework/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/test-framework/">
                <span>Test Engine     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/apm/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/apm/">
                <span>APM     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/02-guide/sharding-jdbc-server/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/sharding-jdbc-server/">
                <span>Sharding-JDBC-Server     </i></span>
              </a>
            </li>
          
        </ul>
        
      </li>
      
      
      

      
      
      
        
          
          
            
          
        
      
      
      

      <li class="dd-item  " data-nav-id="/03-design/">
        <a href="http://shardingjdbc.io/document/legacy/2.x/en/03-design/">
          <span>
            
              <b>3. </b>
            
             Design Plan
            
           </span>
        </a>
        
        <ul>
          
            <li class="dd-item " data-nav-id="/03-design/architecture/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/03-design/architecture/">
                <span>Architecture Design     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/03-design/module/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/03-design/module/">
                <span>Module Declaration     </i></span>
              </a>
            </li>
          
            <li class="dd-item " data-nav-id="/03-design/roadmap/">
              <a href="http://shardingjdbc.io/document/legacy/2.x/en/03-design/roadmap/">
                <span>Roadmap     </i></span>
              </a>
            </li>
          
        </ul>
        
      </li>
      
      
    </ul>
    <hr>
     
  </div>
</nav>

        <section id="body">
        <div id="overlay"></div>

        <div class="padding highlightable">

            <div id="top-bar">
              
              <div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
                  <span id="sidebar-toggle-span">
                      <a href="#" id="sidebar-toggle" data-sidebar-toggle="">
                        <i class="fa fa-bars"></i>
                      </a>
                  </span>
                
                <span id="toc-menu"><a href=""><i class="fa fa-list-alt"></i></a></span>
                
                
                  
                  
                  
                    
                    
                <a href="http://shardingjdbc.io/document/legacy/2.x/en/01-start/" itemprop="url"><span itemprop="title">Introduction</span></a> <i class="fa fa-angle-right"></i>
                    
                  
                
                <span itemprop="title"> The performance-test report</span>
              </div>
              
                  <div class="progress">
    <div class="wrapper">
<nav id="TableOfContents">
<ul>
<li><a href="#the-performance-test-report-of-sharding-jdbc">The performance-test report of Sharding-JDBC</a>
<ul>
<li><a href="#the-summary-of-test-result">The summary of test result</a>
<ul>
<li><a href="#the-baseline-performance-test">The baseline performance test</a></li>
<li><a href="#the-performance-test-for-different-dbs-and-tables-in-jdbc-and-sharding-jdbc">The performance test for different DBs and Tables in JDBC and Sharding-JDBC</a></li>
<li><a href="#sharding-jdbc-v1-4-2与v1-5-2版本对">Sharding-JDBC v1.4.2与v1.5.2版本对</a></li>
</ul></li>
<li><a href="#the-test-purpose">The test purpose</a></li>
<li><a href="#the-test-scene">The test scene</a>
<ul>
<li><a href="#the-business-scene-for-jdbc">The business scene for JDBC</a></li>
<li><a href="#the-business-scene-for-sharding-jdbc">The business scene for Sharding-JDBC</a></li>
</ul></li>
<li><a href="#the-test-method">The test method</a></li>
<li><a href="#the-test-environment">The test environment</a></li>
<li><a href="#the-test-procedure">The test procedure</a></li>
<li><a href="#the-baseline-test">The baseline test</a>
<ul>
<li><a href="#the-select-in-one-table-in-one-db">The SELECT in one table in one DB</a></li>
<li><a href="#the-update-in-one-table-in-one-db">The UPDATE in one table in one DB</a></li>
<li><a href="#the-insert-in-one-table-in-one-db">The INSERT in one table in one DB</a></li>
</ul></li>
<li><a href="#the-limit-test">The limit test</a>
<ul>
<li><a href="#the-select-in-one-table-in-one-db-and-the-select-in-one-table-in-each-of-two-dbs">The SELECT in one table in one DB and The SELECT in one table in each of two DBs</a></li>
<li><a href="#the-select-in-two-tables-in-one-db-and-the-select-in-two-tables-in-each-of-two-dbs">The SELECT in two tables in one DB and The SELECT in two tables in each of two DBs</a></li>
<li><a href="#the-update-in-one-table-in-one-db-and-the-update-in-one-table-in-each-of-two-dbs">The UPDATE in one table in one DB and The UPDATE in one table in each of two DBs</a></li>
<li><a href="#the-update-in-two-tables-in-one-db-and-the-update-in-two-tables-in-each-of-two-dbs">The UPDATE in two tables in one DB and The UPDATE in two tables in each of two DBs</a></li>
<li><a href="#the-insert-in-one-table-in-one-db-and-the-insert-in-one-table-in-each-of-two-dbs">The INSERT in one table in one DB and The INSERT in one table in each of two DBs</a></li>
<li><a href="#the-insert-in-two-tables-in-one-db-and-the-insert-in-two-tables-in-each-of-two-dbs">The INSERT in two tables in one DB and The INSERT in two tables in each of two DBs</a></li>
<li><a href="#the-operations-in-one-table-in-each-of-two-dbs-for-sharding-jdbc-1-4-2-and-1-5-2">The operations in one table in each of two DBs for Sharding-JDBC 1.4.2 and 1.5.2</a></li>
</ul></li>
<li><a href="#the-appendix">The appendix</a>
<ul>
<li><a href="#the-sql-of-creating-tables">The SQL of creating tables</a></li>
<li><a href="#sql-statements">SQL Statements</a></li>
</ul></li>
</ul></li>
</ul>
</nav>
    </div>
</div>

              

            </div>
            
              <div id="body-inner">
                
                <h1>The performance-test report</h1>
                



<h1 id="the-performance-test-report-of-sharding-jdbc">The performance-test report of Sharding-JDBC</h1>

<h2 id="the-summary-of-test-result">The summary of test result</h2>

<p>1、The test of performance lose: When the server resources are sufficient and the number of concurrency is the same, we compare the performance loss of JDBC and Sharding-JDBC, the result is that the performance loss of Sharding-JDBC is less than 7%, compared with JDBC.<br>
2、The test of performance: The server resources are used to the limit, the throughput of Sharding-JDBC and JDBC are on a fairly level.<br>
3、The test of performance: The server resources are used to the limit, the throughput of Sharding-JDBC with Sharding is improved nearly twice than JDBC without Sharding.<br>
4、The test of performance: The server resources are used to the limit, The performance of Sharding-JDBC V1.5.2 is more stable V1.4.2.<br></p>

<h3 id="the-baseline-performance-test">The baseline performance test</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">JDBC</th>
<th align="left">Sharding-JDBC1.5.2</th>
<th align="left">The loss ratio of Sharding-JDBC1.5.2/JDBC</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The SELECT for single table in single DB</td>
<td align="left">493</td>
<td align="left">470</td>
<td align="left">4.7%</td>
</tr>

<tr>
<td align="left">The UPDATE for single table in single DB</td>
<td align="left">6682</td>
<td align="left">6303</td>
<td align="left">5.7%</td>
</tr>

<tr>
<td align="left">The INSERT for single table in single DB</td>
<td align="left">6855</td>
<td align="left">6375</td>
<td align="left">7%</td>
</tr>
</tbody>
</table>

<h3 id="the-performance-test-for-different-dbs-and-tables-in-jdbc-and-sharding-jdbc">The performance test for different DBs and Tables in JDBC and Sharding-JDBC</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Two tables in single DB for JDBC</th>
<th align="left">Two tables in each of two DBs for Sharding-JDBC</th>
<th align="left">The improved performance percentage</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">SELECT</td>
<td align="left">1736</td>
<td align="left">3331</td>
<td align="left">192%</td>
</tr>

<tr>
<td align="left">UPDATE</td>
<td align="left">9170</td>
<td align="left">17997</td>
<td align="left">196%</td>
</tr>

<tr>
<td align="left">INSERT</td>
<td align="left">11574</td>
<td align="left">23043</td>
<td align="left">199%</td>
</tr>
</tbody>
</table>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">One table in single DB for JDBC</th>
<th align="left">One table in each of two DBs for Sharding-JDBC</th>
<th align="left">The improved performance percentage</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">SELECT</td>
<td align="left">1586</td>
<td align="left">2944</td>
<td align="left">185%</td>
</tr>

<tr>
<td align="left">UPDATE</td>
<td align="left">9548</td>
<td align="left">18561</td>
<td align="left">194%</td>
</tr>

<tr>
<td align="left">INSERT</td>
<td align="left">11182</td>
<td align="left">21414</td>
<td align="left">192%</td>
</tr>
</tbody>
</table>

<h3 id="sharding-jdbc-v1-4-2与v1-5-2版本对">Sharding-JDBC v1.4.2与v1.5.2版本对</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Sharding-JDBC 1.4.2&emsp;</th>
<th align="left">Sharding-JDBC 1.5.2&emsp;&emsp;&emsp;</th>
<th align="left">The improved ratio of 1.5.<sup>2</sup>&frasl;<sub>1</sub>.4.2</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">SELECT</td>
<td align="left">2934</td>
<td align="left">2944</td>
<td align="left">100.34%</td>
</tr>

<tr>
<td align="left">UPDATE</td>
<td align="left">18454</td>
<td align="left">18561</td>
<td align="left">100.58%</td>
</tr>

<tr>
<td align="left">INSERT</td>
<td align="left">21045</td>
<td align="left">21414</td>
<td align="left">101.75%</td>
</tr>
</tbody>
</table>

<h2 id="the-test-purpose">The test purpose</h2>

<ul>
<li>To get the performance loss comparison between Sharding-JDBC 1.5.2 and JDBC.</li>
<li>To get the performance loss comparison between Sharding-jdbc 1.52 and 1.4.2.</li>
<li>To check whether there are performance problems in Sharding-JDBC 1.5.2.</li>
</ul>

<h2 id="the-test-scene">The test scene</h2>

<h3 id="the-business-scene-for-jdbc">The business scene for JDBC</h3>

<table>
<thead>
<tr>
<th align="left">Operation&emsp;&emsp;&emsp;</th>
<th align="left">The operation abbreviation&emsp;&emsp;&emsp;&emsp;</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The SELECT in one table in one DB</td>
<td align="left">JSdbStSelect</td>
</tr>

<tr>
<td align="left">The INSERT in one table in one DB</td>
<td align="left">JSdbStInsert</td>
</tr>

<tr>
<td align="left">The UPDATE in one table in one DB</td>
<td align="left">JSdbStUpdate</td>
</tr>

<tr>
<td align="left">The SELECT in two tables in one DB</td>
<td align="left">JSdbMtSelect</td>
</tr>

<tr>
<td align="left">The INSERT in two tables in one DB</td>
<td align="left">JSdbMtInsert</td>
</tr>

<tr>
<td align="left">The UPDATE in two tables in one DB</td>
<td align="left">JSdbMtUpdate</td>
</tr>
</tbody>
</table>

<h3 id="the-business-scene-for-sharding-jdbc">The business scene for Sharding-JDBC</h3>

<table>
<thead>
<tr>
<th align="left">Operation&emsp;&emsp;&emsp;</th>
<th align="left">The operation abbreviation&emsp;&emsp;&emsp;&emsp;</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The SELECT in one table in one DB</td>
<td align="left">SJSdbStSelect</td>
</tr>

<tr>
<td align="left">The INSERT in one table in one DB</td>
<td align="left">SJSdbStInsert</td>
</tr>

<tr>
<td align="left">The UPDATE in one table in one DB</td>
<td align="left">SJSdbStUpdate</td>
</tr>

<tr>
<td align="left">The SELECT in two tables in one DB</td>
<td align="left">SJSdbMtSelect</td>
</tr>

<tr>
<td align="left">The INSERT in two tables in one DB</td>
<td align="left">SJSdbMtInsert</td>
</tr>

<tr>
<td align="left">The UPDATE in two tables in one DB</td>
<td align="left">SJSdbMtUpdate</td>
</tr>

<tr>
<td align="left">The SELECT in one table in each of two DBs</td>
<td align="left">SJMdbStSelect</td>
</tr>

<tr>
<td align="left">The INSERT in one table in each of two DBs</td>
<td align="left">SJMdbStInsert</td>
</tr>

<tr>
<td align="left">The UPDATE in one table in each of two DBs</td>
<td align="left">SJMdbStUpdate</td>
</tr>

<tr>
<td align="left">The SELECT in two tables in each of two DBs</td>
<td align="left">SJMdbMtSelect</td>
</tr>

<tr>
<td align="left">The INSERT in two tables in each of two DBs</td>
<td align="left">SJMdbMtInsert</td>
</tr>

<tr>
<td align="left">The UPDATE in two tables in each of two DBs</td>
<td align="left">SJMdbMtUpdate</td>
</tr>
</tbody>
</table>

<p>The limit test scope is the whole operations, and the baseline test scope is the following operations:</p>

<table>
<thead>
<tr>
<th align="left">Operation&emsp;&emsp;&emsp;</th>
<th align="left">The operation abbreviation&emsp;&emsp;&emsp;&emsp;</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The SELECT in one table in one DB</td>
<td align="left">JSdbStSelect</td>
</tr>

<tr>
<td align="left">The INSERT in one table in one DB</td>
<td align="left">JSdbStInsert</td>
</tr>

<tr>
<td align="left">The UPDATE in one table in one DB</td>
<td align="left">JSdbStUpdate</td>
</tr>

<tr>
<td align="left">The SELECT in one table in one DB</td>
<td align="left">SJSdbStSelect</td>
</tr>

<tr>
<td align="left">The INSERT in one table in one DB</td>
<td align="left">SJSdbStInsert</td>
</tr>

<tr>
<td align="left">The UPDATE in one table in one DB</td>
<td align="left">SJSdbStUpdate</td>
</tr>
</tbody>
</table>

<h2 id="the-test-method">The test method</h2>

<p>The baseline test: the server resources are sufficient and the number of concurrency is the same.<br>
The limit test: The server resources are used to the limit, and TPS is no longer increasing.</p>

<h2 id="the-test-environment">The test environment</h2>

<p>The Server Configuration:</p>

<table>
<thead>
<tr>
<th align="left">DB-Name</th>
<th align="left">Hardware Information</th>
<th align="left">Software Information</th>
<th align="left">Hybrid Application</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">DB0</td>
<td align="left">OS：CentOS 6.6 64bit<br/>CPU：2C 4core<br/>Memory：32G<br/>Storage：250G*2_RAID1+600G*4_RAID10<br/>Network card：1000mbps</td>
<td align="left">Mysql 5.7.13</td>
<td align="left">N</td>
</tr>

<tr>
<td align="left">DB1</td>
<td align="left">OS：CentOS 6.6 64bit<br/>CPU：2C 4core<br/>Memory：32G<br/>Storage：250G*2_RAID1+600G*4_RAID10<br/>Network card：1000mbps</td>
<td align="left">Mysql 5.7.13</td>
<td align="left">N</td>
</tr>
</tbody>
</table>

<h2 id="the-test-procedure">The test procedure</h2>

<h2 id="the-baseline-test">The baseline test</h2>

<h3 id="the-select-in-one-table-in-one-db">The SELECT in one table in one DB</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Average response time(ms)</th>
<th align="left">TPS</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The SELECT in one table in one DB for JDBC</td>
<td align="left">7</td>
<td align="left">493</td>
</tr>

<tr>
<td align="left">The SELECT in one table in one DB for Sharding-JDBC 1.5.2</td>
<td align="left">8</td>
<td align="left">470</td>
</tr>
</tbody>
</table>

<p>The display of TPS info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/b-SdbSt-query-tps.png" alt="TPS" /></p>

<p>The display of RT info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/b-SdbSt-query-rt.png" alt="RT" /></p>

<h3 id="the-update-in-one-table-in-one-db">The UPDATE in one table in one DB</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Average response time(ms)</th>
<th align="left">TPS</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The UPDATE in one table in one DB for JDBC</td>
<td align="left">2</td>
<td align="left">6682</td>
</tr>

<tr>
<td align="left">The UPDATE in one table in one DB for Sharding-JDBC 1.5.2</td>
<td align="left">3</td>
<td align="left">6303</td>
</tr>
</tbody>
</table>

<p>The display of TPS info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/b-SdbSt-update-tps.png" alt="TPS" /></p>

<p>The display of RT info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/b-SdbSt-update-rt.png" alt="RT" /></p>

<h3 id="the-insert-in-one-table-in-one-db">The INSERT in one table in one DB</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Average response time(ms)</th>
<th align="left">TPS</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The INSERT in one table in one DB for JDBC</td>
<td align="left">2</td>
<td align="left">6855</td>
</tr>

<tr>
<td align="left">The INSERT in one table in one DB for Sharding-JDBC 1.5.2</td>
<td align="left">2</td>
<td align="left">6375</td>
</tr>
</tbody>
</table>

<p>The display of TPS info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/b-SdbSt-insert-tps.png" alt="TPS" /></p>

<p>The display of RT info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/b-SdbSt-insert-rt.png" alt="RT" /></p>

<h2 id="the-limit-test">The limit test</h2>

<h3 id="the-select-in-one-table-in-one-db-and-the-select-in-one-table-in-each-of-two-dbs">The SELECT in one table in one DB and The SELECT in one table in each of two DBs</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Average response time(ms)</th>
<th align="left">TPS</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The SELECT in one table in one DB for JDBC</td>
<td align="left">7</td>
<td align="left">1586</td>
</tr>

<tr>
<td align="left">Sharding-JDBC 1.5.2单库单表查询</td>
<td align="left">7</td>
<td align="left">1600</td>
</tr>

<tr>
<td align="left">Sharding-JDBC 1.5.2两库各1表查询</td>
<td align="left">13</td>
<td align="left">2944</td>
</tr>
</tbody>
</table>

<p>The display of TPS info</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbSt-MdbSt-query-tps.png" alt="TPS" /></p>

<p>The display of RT info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbSt-MdbSt-query-rt.png" alt="RT" /></p>

<h3 id="the-select-in-two-tables-in-one-db-and-the-select-in-two-tables-in-each-of-two-dbs">The SELECT in two tables in one DB and The SELECT in two tables in each of two DBs</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Average response time(ms)</th>
<th align="left">TPS</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The SELECT in two tables in one DB for JDBC</td>
<td align="left">6</td>
<td align="left">1736</td>
</tr>

<tr>
<td align="left">The SELECT in two tables in one DB for Sharding-JDBC 1.5.2</td>
<td align="left">7</td>
<td align="left">1732</td>
</tr>

<tr>
<td align="left">The SELECT in two tables in each of two DBs for Sharding-JDBC</td>
<td align="left">10</td>
<td align="left">3331</td>
</tr>
</tbody>
</table>

<p>The display of TPS info</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbMt-MdbMt-query-tps.png" alt="TPS" /></p>

<p>The display of RT info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbMt-MdbMt-query-rt.png" alt="RT" /></p>

<h3 id="the-update-in-one-table-in-one-db-and-the-update-in-one-table-in-each-of-two-dbs">The UPDATE in one table in one DB and The UPDATE in one table in each of two DBs</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Average response time(ms)</th>
<th align="left">TPS</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The UPDATE in two tables in one DB for JDBC</td>
<td align="left">7</td>
<td align="left">9548</td>
</tr>

<tr>
<td align="left">The UPDATE in one table in one DB for Sharding-JDBC 1.5.2</td>
<td align="left">7</td>
<td align="left">9263</td>
</tr>

<tr>
<td align="left">The UPDATE in one table in each of two DBs for Sharding-JDBC 1.5.2</td>
<td align="left">4</td>
<td align="left">18561</td>
</tr>
</tbody>
</table>

<p>The display of TPS info</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbSt-MdbSt-update-tps.png" alt="TPS" /></p>

<p>The display of RT info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbSt-MdbSt-update-rt.png" alt="RT" /></p>

<h3 id="the-update-in-two-tables-in-one-db-and-the-update-in-two-tables-in-each-of-two-dbs">The UPDATE in two tables in one DB and The UPDATE in two tables in each of two DBs</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Average response time(ms)</th>
<th align="left">TPS</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The UPDATE in two tables in one DB for JDBC</td>
<td align="left">7</td>
<td align="left">9170</td>
</tr>

<tr>
<td align="left">The UPDATE in two tables in one DB for Sharding-JDBC 1.5.2</td>
<td align="left">7</td>
<td align="left">8941</td>
</tr>

<tr>
<td align="left">The UPDATE in two tables in each of two DBs for Sharding-JDBC 1.5.2</td>
<td align="left">5</td>
<td align="left">17997</td>
</tr>
</tbody>
</table>

<p>The display of TPS info</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbMt-MdbMt-update-tps.png" alt="TPS" /></p>

<p>The display of RT info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbMt-MdbMt-update-rt.png" alt="RT" /></p>

<h3 id="the-insert-in-one-table-in-one-db-and-the-insert-in-one-table-in-each-of-two-dbs">The INSERT in one table in one DB and The INSERT in one table in each of two DBs</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Average response time(ms)</th>
<th align="left">TPS</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The INSERT in one table in one DB for JDBC</td>
<td align="left">5</td>
<td align="left">11182</td>
</tr>

<tr>
<td align="left">The INSERT in one table in one DB for Sharding-JDBC 1.5.2</td>
<td align="left">5</td>
<td align="left">10882</td>
</tr>

<tr>
<td align="left">The INSERT in one table in each of two DBs for Sharding-JDBC 1.5.2</td>
<td align="left">4</td>
<td align="left">21414</td>
</tr>
</tbody>
</table>

<p>The display of TPS info</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbSt-MdbSt-insert-tps.png" alt="TPS" /></p>

<p>The display of RT info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbSt-MdbSt-insert-rt.png" alt="RT" /></p>

<h3 id="the-insert-in-two-tables-in-one-db-and-the-insert-in-two-tables-in-each-of-two-dbs">The INSERT in two tables in one DB and The INSERT in two tables in each of two DBs</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Average response time(ms)</th>
<th align="left">TPS</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">The INSERT in two tables in one DB for JDBC</td>
<td align="left">4</td>
<td align="left">11574</td>
</tr>

<tr>
<td align="left">The INSERT in two tables in one DB for Sharding-JDBC 1.5.2</td>
<td align="left">5</td>
<td align="left">10849</td>
</tr>

<tr>
<td align="left">The INSERT in two tables in each of two DBs Sharding-JDBC 1.5.2</td>
<td align="left">4</td>
<td align="left">23043</td>
</tr>
</tbody>
</table>

<p>The display of TPS info</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbMt-MdbMt-insert-tps.png" alt="TPS" /></p>

<p>The display of RT info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/l-SdbMt-MdbMt-insert-rt.png" alt="RT" /></p>

<h3 id="the-operations-in-one-table-in-each-of-two-dbs-for-sharding-jdbc-1-4-2-and-1-5-2">The operations in one table in each of two DBs for Sharding-JDBC 1.4.2 and 1.5.2</h3>

<table>
<thead>
<tr>
<th align="left">Operation</th>
<th align="left">Sharding-JDBC 1.4.2&emsp;</th>
<th align="left">Sharding-JDBC 1.5.2&emsp;&emsp;&emsp;</th>
<th align="left">1.5.<sup>2</sup>&frasl;<sub>1</sub>.4.2&emsp;</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">SELECT</td>
<td align="left">2934</td>
<td align="left">2944</td>
<td align="left">100.34%</td>
</tr>

<tr>
<td align="left">UPDATE</td>
<td align="left">18454</td>
<td align="left">18561</td>
<td align="left">100.58%</td>
</tr>

<tr>
<td align="left">INSERT</td>
<td align="left">21045</td>
<td align="left">21414</td>
<td align="left">101.75%</td>
</tr>
</tbody>
</table>

<p>The display of TPS info</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/152vs142tps.png" alt="TPS" /></p>

<p>The display of RT info:</p>

<p><img src="http://shardingjdbc.io/document/legacy/2.x/en/img/152vs142rt.png" alt="RT" /></p>

<h2 id="the-appendix">The appendix</h2>

<p>There are two test servers, and two parent tables and two child tables in single database in each of servers.</p>

<h3 id="the-sql-of-creating-tables">The SQL of creating tables</h3>

<p>The structure of parent table:</p>

<pre><code class="language-sql">order_0 | CREATE TABLE `order_0` (
  `id` bigint(50) NOT NULL AUTO_INCREMENT,
  `order_id` varchar(50) NOT NULL,
  `order_type` int(11) DEFAULT NULL,
  `cust_id` int(11) DEFAULT NULL,
  `cust_type` int(11) DEFAULT NULL,
  `cust_email` varchar(50) DEFAULT NULL,
  `payment_method_type` int(11) DEFAULT NULL,
  `payment_provider_id` int(11) DEFAULT NULL,
  `shipping_method_type` int(11) DEFAULT NULL,
  `packing_type` int(11) DEFAULT NULL,
  `preferred_shipping_time_type` int(11) DEFAULT NULL,
  `receiver_name` varchar(100) DEFAULT NULL,
  `receiver_address` varchar(200) DEFAULT NULL,
  `receiver_country_id` int(11) DEFAULT NULL,
  `receiver_province_id` int(11) DEFAULT NULL,
  `receiver_city_id` int(11) DEFAULT NULL,
  `receiver_zip` varchar(20) DEFAULT NULL,
  `receiver_tel` varchar(50) DEFAULT NULL,
  `receiver_mobile_tel` varchar(50) DEFAULT NULL,
  `cust_message` varchar(500) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_id` (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5189307 DEFAULT CHARSET=gbk 
</code></pre>

<p>The structure of child table:</p>

<pre><code class="language-sql">ordert_0 | CREATE TABLE `ordert_0` (
  `idm` bigint(50) NOT NULL,
  `id` int(10) DEFAULT NULL,
  `order_idm` varchar(50) DEFAULT NULL,
  `order_typem` int(11) DEFAULT NULL,
  `cust_idm` int(11) DEFAULT NULL,
  `cust_typem` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=gbk ROW_FORMAT=DYNAMIC
</code></pre>

<h3 id="sql-statements">SQL Statements</h3>

<p>JDBC INSERT</p>

<pre><code class="language-sql">insert 
into order_?(order_id,order_type,cust_id,cust_type,cust_email,payment_method_type,payment_provider_id,shipping_method_type,packing_type,preferred_shipping_time_type,receiver_name,receiver_address,receiver_country_id,receiver_province_id,receiver_city_id,receiver_zip,receiver_tel,receiver_mobile_tel,cust_message) VALUES (?, 0, 10, 1, 'dtest002@dangdang.com', 1, 6, 1, 0, 3, 'ttt ttt', 'beijingshijinganzhongxin', 9000, 111, 1, '100011', '51236117', ' ', ' ');
</code></pre>

<p>JDBC SELECT</p>

<pre><code class="language-sql">select a.id,order_id,order_type,cust_id,cust_type,cust_email,payment_method_type,payment_provider_id,shipping_method_type,packing_type,preferred_shipping_time_type,receiver_name,receiver_address,receiver_country_id,receiver_province_id,receiver_city_id,receiver_zip,receiver_tel,receiver_mobile_tel,cust_message from order_? a,ordert_? b where a.id=? and a.id%100=b.idm%100;
</code></pre>

<p>JDBC UPDATE</p>

<pre><code class="language-sql">Update order_? SET order_id=?,order_type=0,cust_id=10,cust_type=1,cust_email='dtest002@dangdang.com' where id=?;
</code></pre>

<p>Sharding-JDBC INSERT</p>

<pre><code class="language-sql">INSERT INTO `order`(order_id,order_type,cust_id,cust_type,cust_email,payment_method_type,payment_provider_id,shipping_method_type,packing_type,preferred_shipping_time_type,receiver_name,receiver_address,receiver_country_id,receiver_province_id,receiver_city_id,receiver_zip,receiver_tel,receiver_mobile_tel,cust_message) VALUES (?, 0, 10, 1, 'dtest002@dangdang.com', 1, 6, 1, 0, 3, 'ttt ttt', 'beijingshijinganzhongxin', 9000, 111, 1, '100011', '51236117', ' ', ' ');
</code></pre>

<p>Sharding-JDBC SELECT</p>

<pre><code class="language-sql">select cust_id,cust_type,cust_email,payment_method_type,payment_provider_id,shipping_method_type,packing_type,preferred_shipping_time_type,receiver_name,receiver_address,receiver_country_id,receiver_province_id,receiver_city_id,receiver_zip,receiver_tel,receiver_mobile_tel,cust_message from order a,order_item b where a.id=? and a.id%100=b.idm%100;
</code></pre>

<p>Sharding-JDBC UPDATE</p>

<pre><code class="language-sql">update order SET order_id=?,order_type=0,cust_id=10,cust_type=1,cust_email='dtest002@dangdang.com' where id=?;
</code></pre>


      
      
      </div>
    </div>

    

    <div id="navigation">
        
        <a class="nav nav-prev" href="http://shardingjdbc.io/document/legacy/2.x/en/01-start/sql-supported/"> <i class="fa fa-chevron-left"></i></a>
        <a class="nav nav-next" href="http://shardingjdbc.io/document/legacy/2.x/en/02-guide/" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
    </div>

    </section>
    <div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
      <div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
    </div>
    <script src="http://ovfotjrsi.bkt.clouddn.com/docs/js/clipboard.min.js"></script>
    <script src="http://ovfotjrsi.bkt.clouddn.com/docs/js/perfect-scrollbar.min.js"></script>
    <script src="http://ovfotjrsi.bkt.clouddn.com/docs/js/perfect-scrollbar.jquery.min.js"></script>
    <script src="http://ovfotjrsi.bkt.clouddn.com/docs/js/jquery.sticky-kit.min.js"></script>
    <script src="http://ovfotjrsi.bkt.clouddn.com/docs/js/featherlight.min.js"></script>
    <script src="http://ovfotjrsi.bkt.clouddn.com/docs/js/html5shiv-printshiv.min.js"></script>
    <script src="http://ovfotjrsi.bkt.clouddn.com/docs/js/highlight.pack.js"></script>
    <script>hljs.initHighlightingOnLoad();</script>
    <script src="http://ovfotjrsi.bkt.clouddn.com/docs/js/learn.js"></script>
    <script src="http://ovfotjrsi.bkt.clouddn.com/docs/js/hugo-learn.js"></script>
    <script src="http://cdn.bootcss.com/highlight.js/9.8.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

  </body>
</html>

